RCU: let the RCU idle timer handler run
authorDario Faggioli <dario.faggioli@citrix.com>
Mon, 9 Oct 2017 11:22:07 +0000 (13:22 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 9 Oct 2017 11:22:07 +0000 (13:22 +0200)
commit9e0a3a2a9143c17319660e22dcf4b7a59fa9473e
treee2809c81b88aa4b67e8550ad5ee58b30f9a72add
parent3e4bc919cb1d1e18318a9f95de5e84a75c8f5266
RCU: let the RCU idle timer handler run

If stop_timer() is called between when the RCU
idle timer's interrupt arrives (and TIMER_SOFTIRQ is
raised) and when softirqs are checked and handled, the
timer is deactivated, and the handler never runs.

This happens to the RCU idle timer because stop_timer()
is called on it during the wakeup from idle (e.g., C-states,
on x86) path.

To fix that, we avoid calling stop_timer(), in case we see
that the timer itself is:
- still active,
- expired (i.e., it's expiry time is in the past).
In fact, that indicates (for this particular timer) that
it has fired, and we are just about to handle the TIMER_SOFTIRQ
(which will perform the timer deactivation and run its handler).

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/rcupdate.c
xen/common/timer.c
xen/include/xen/timer.h